﻿@model CmsContentModel
@{
    ResFile = "cms_Content";
}

<div class="b-form b-form_bordered b-form_theme_white @(Model.EditMode != EditMode.Usual? "b-form_diabled":"")">
    <div class="b-form__head b-form__head-allbordered">
        <fieldset class="b-form">
            <ol class="b-form__rows ul-reset g-clear">
                <li class="b-form__row g-clear">
                    <label for="ContentTitle">@_("Title")</label>
                    @Html.TextBoxFor(p => p.ContentTitle, new { @class = "text text_long" })
                    @Html.ValidationMessageFor(p => p.ContentTitle)
                </li>
                @if (Model.ContentType.IsSummaryEditable)
                {
                    <li class="b-form__row g-clear b-form__row_textarea">
                        <label for="ContentSummary">@_("Summary")</label>
                        @Html.TextAreaFor(p => p.ContentSummary, new { @class = "text textarea" })
                    </li>
                }
                @if (Model.ContentType.IsBodyEditable)
                {
                    <li class="b-form__row g-clear telerik-on-content-type">
                        <label>@_("Content")</label>
                        @{ Html.RenderPartial("telerikeditor", new { ClientId = Model.Id, Name = "ContentBody", Content = Model.ContentBody, ContentId = Model.Id }.ToExpando()); }
                    </li>
                }
            </ol>
            @Html.Action("EntityMetaValues", "CmsMetaField", new { metaInformation = Model.MetaInformation, isValid = ViewData.ModelState.IsValid })
            <ol class="b-form__rows ul-reset g-clear">
                <li class="b-form__row g-clear">
                    <label for="PublishStartDate">@_("Publish from")</label>
                    @(Html.Telerik().DatePicker()
                .Name("PublishStartDate")
                .InputHtmlAttributes(new { @class = "text b-text_date" })
                .ShowButton(true))
                </li>
                <li class="b-form__row g-clear">
                    <label for="PublishEndDate">@_("Publish to")</label>
                    @(Html.Telerik().DatePicker()
                .Name("PublishEndDate")
                .InputHtmlAttributes(new { @class = "text b-text_date" })
                .ShowButton(true))
                </li>
                <li>
                    @if (!Model.IsNew)
                    {
                        @Html.HiddenFor(p => p.Id)
                    }
                    @Html.HiddenFor(p => p.ContentTypeId)
                </li>
                @(Html.UserGroupPlaceholder().ForUserGroups(PredefinedUserGroups.Developer).Template(
                @<text>
                    <li class="b-form__row g-clear">
                        <label>@_("Item scope")</label>
                        @Html.Partial("SiteAwarePlug", Model)
                    </li>
                </text>).Render())
            </ol>
        </fieldset>
    </div>
</div>
